package org.example.util;

public class ArrayUtil {

    public static String join2String(String[] array, String joint){

        StringBuilder stringBuilder = new StringBuilder();

        for (int i = 0; i < array.length; i++) {
            stringBuilder.append(array[i]).append(joint);

        }

        if(stringBuilder.length() > joint.length()){
            return stringBuilder.substring(0, stringBuilder.length() - joint.length());

        }

        return stringBuilder.toString();

    }
}

